﻿<html>

	<head>
		<title>新增快递</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">

		<link href="../../css/skin/default/style.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="../../css/dialog.css">
		<link href="../../js/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

		<script src="../../js/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>

		<script src="../../js/lib/ligerUI/js/plugins/ligerPopupEdit.js"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerRadio.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTip.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
		<script src="../../js/JS/XHD.js" type="text/javascript"></script>
		<script src="../../js/lib/jquery.form.js" type="text/javascript"></script>
		<script src="../../js/lib/json2.js" type="text/javascript"></script>
		<script src="../../js/dialog.js"></script>
		<script src="../../js/JS/layout.js"></script>
		<script src="../../js/constants.js" type="text/javascript"></script>
		<script src="../../js/api.js" type="text/javascript"></script>

		<script type="text/javascript">
			var row; 
			$(function() {

				$("form").ligerForm();
				
				 
//				var  Isuser = $('input[type="radio"][name="IsUser"]').eq(0);
//				$(Isuser).attr("checked", "checked");
				
				
				row = JSON.parse(unescape($api.getparastr("data")));
				
				if(!isEmpty(row)) {
					id = row.ID;
					$api.loadJsonToForm(row);
//					$("#Morder").val(row.Morder);
//					$("#FullName").val(row.FullName);
//					$("#Express").val(row.Express); 
					if(row.IsUser)
						$('input[name="IsUser"]').eq(0).attr("checked", true);
					else
						$('input[name="IsUser"]').eq(1).attr("checked", true);
				}
				else
					$('input[name="IsUser"]').eq(0).attr("checked", true);
				$(".rule-multi-radio").ruleMultiRadio();

			});

			function f_save() { 
				if($api.isEmpty($("#FullName").val())){
					alert("快递名称不能为空！");
					return;
				}
				if($api.isEmpty($("#Express").val())) {
					alert("快递简称不能为空！");
					return;
				}
				var isuser = $('input[name="IsUser"]:checked').val();
				if(!$api.isEmpty(row)) {
					//
					//var sendtxt = "&Action=edit&id=" + row.ID + "&isuser=" + IsUserManager.getValue();
					var ret = $("form").serializeObject();
					ret.ID = row.ID;
					ret.IsUser = isuser;
					//	ret.action = "edit";
					var obj = {
						"data":ret,
						"action":"edit"
					}
					return obj;

				} else {
					var ret = $("form").serializeObject();
					ret.IsUser = isuser;
					//ret.action = "add";
					//var sendtxt = "&Action=add&isuser=" + IsUserManager.getValue();
					var obj = {
						"data":ret,
						"action":"add"
					}
					return obj;
				}

			}
		</script>
	</head>

	<body class="mainbody">
		<form>
			<div class="div-content">
				<div class="divhead">填写快递信息</div>
				<hr class="divline" />
				<dl>
					<dt>快递全称</dt>
					<dd>
						<div style="float:left">
							<input type="text" id="FullName" maxlength="16" name="FullName" ltype="text" ligerui="{width:200}" validate="{required:true,minlength:4,maxlength:30}" />
						</div>
						<div style="float:left"> <span class="Validform_checktip" id="lnum" style="float:left">*必须填写</span></div>
					</dd>
				</dl>
				<dl>
					<dt>快递简称</dt>
					<dd>
						<input type="text" id="Express" name="Express" ltype="text" ligerui="{width:180}" validate="{required:true}" />
					</dd>
				</dl>

				<dl>
					<dt>排序号</dt>
					<dd>
						<div style="float:left">
							<input type="text" id="Morder" name="Morder" ltype="text" ligerui="{width:180}" validate="{required:true;number:true}" />
						</div>

					</dd>
				</dl>

				<dl>
					<dt>状态</dt>
					<dd>
						<div class="rule-multi-radio">
							<label><input type="radio" value="true"   name="IsUser">正常</label>
							<label><input type="radio" value="false"  name="IsUser">冻结</label>
						</div>
					</dd>
				</dl>
			</div>
		</form>
	</body>

</html>